﻿#ifndef INSTRUCTIONTHERMOSTATDISCONNECT
#define INSTRUCTIONTHERMOSTATDISCONNECT
#include "ScriptInstruction.h"

class InstructionThermostatDisconnect :public ScriptInstruction
{
	Q_OBJECT
private:
	ScriptRunner* scriptRunner = Q_NULLPTR;
	TurnTableCodec* turnTableCodec = Q_NULLPTR;
public:
	InstructionThermostatDisconnect()
	{
		scriptRunner = ScriptInstruction::getScriptRunner();
		turnTableCodec = ScriptInstruction::getTurnTableCodec();
		instructionFlag = Instruction_Thermostat_Disconnect;
	}
	~InstructionThermostatDisconnect(){}
public:
	void run()override
	{
		turnTableCodec->sendInstruction(TurnTableCodec::Thermostat_Disconnect,0,0,0);
		scriptRunner->scriptWaitAndRun(scriptRunner->getInterval_instruction());
	}
	QVector<float> getDataForSaving()override
	{
		QVector<float> savingData;
		savingData.append(instructionFlag);
		return savingData;
	}
};
#endif
